#ifndef _VECTOR_H_
#define _VECTOR_H_

#define NUMERO_ELEMENTOS 4
#include <cmath>
#include <iostream>
using namespace std;

class Vector3
{
    private:
        float elementos[NUMERO_ELEMENTOS];

    public:
        Vector3(void);
        Vector3(float x, float y, float z);
        ~Vector3(){}

        float& operator()(unsigned int posicao){return(elementos[posicao]);}
        const float& operator()(unsigned int posicao) const{return(elementos[posicao]);}

        void imprimir(void) const;

        Vector3 operator+(const Vector3 & other) const;
        Vector3 operator-(const Vector3 & other) const;

        float length() const;
        float squaredLength() const;
        Vector3 normalize() const;
};

class Point3
{
    private:
        float elementos[NUMERO_ELEMENTOS];

    public:
        Point3(void);
        Point3(float x, float y, float z);
        Point3(const Vector3 & vector);
        ~Point3(){}

        float& operator()(unsigned int posicao){return(elementos[posicao]);}
        const float& operator()(unsigned int posicao) const{return(elementos[posicao]);}

        void imprimir(void) const;

        Point3 operator+(const Vector3 & vector) const;
        Vector3 operator-(const Point3 & other) const;

        Vector3 toVector3() const;
};

// Operador "arroba":
Vector3 operator&(const Vector3 & v1, const Vector3 & v2);

float dotProduct(const Vector3 & v1, const Vector3 & v2);
float operator^(const Vector3 & v1, const Vector3 & v2);

Vector3 crossProduct(const Vector3 & v1, const Vector3 & v2);
Vector3 operator*(const Vector3 & v1, const Vector3 & v2);

Vector3 operator*(float value, const Vector3 & vector);
Vector3 operator*(const Vector3 & vector, float value);

Vector3 operator/(const Vector3 & vector, float value);
//Vector3 operator/(float value, const Vector3 & vector);

#endif
